package utils

import "encoding/base64"

// base64解密

func DecodeBase64(source string) (dest string, err error) {
	destByte, err := base64.StdEncoding.DecodeString(source)
	if err != nil {
		return "", err
	}
	dest = string(destByte)
	return dest, nil
}

func EncodeBase64(context []byte) (string, error) {
	toString := base64.StdEncoding.EncodeToString(context)
	return toString, nil
}
